<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    {% load static %}
    {#    <link rel="stylesheet" href="/static/jQuery3.4.1.js">#}
    <script src="/static/jQuery3.4.1.js"></script>
    <link rel="stylesheet" href={% static 'css/dashboard.css' %}>
    <link rel="stylesheet" href={% static 'css/bootstrap.css' %}>

    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
    {% block css %}

    {% endblock %}
    {% block margin %}

    {% endblock %}
</head>

<body>

{% include 'nav.html' %}
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li class="active"><a href="#">Overview <span class="sr-only">(current)</span></a></li>
                <li {% block k1 %}{% endblock %}><a href="{% url 'user' %}">用户</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li {% block k2 %}{% endblock %}><a href="{% url 'lab' %}">实验室</a></li>
            </ul>

            <ul class="nav nav-sidebar">
                <li {% block k3 %}{% endblock %}><a href="{% url 'asset' %}">物资</a></li>
            </ul>

        </div>
        {% block asset %}

        {% endblock %}
    </div>
</div>


{% block drop %}

{% endblock %}


</body>
<script>
    $('.ajax').click(function () {
        swal({
            title: "确认删除数据吗?",
            text: "删除后无法恢复",
            icon: "warning",
            buttons: true,
            dangerMode: true,
        })
            .then((willDelete) => {
                if (willDelete) {
                    var y = $(this).parent().parent();
                    $.ajax({
                        'url': '/a_remove/',
                        'type': 'post',
                        'data': {
                            'k1': $(this).attr('name'),
                            'k2': $(this).attr('id'),
                        },

                        success: function (ret) {

                            y.remove();


                        },
                        error: function (ret) {


                        }

                        });
                    swal("数据已经删除!", {
                        icon: "success",
                    });
                } else {
                    swal("删除请求以撤销!");
                }
            });


    })


</script>
<script src="/static/js/bootstrap.js"></script>

{% block ajax %}

{% endblock %}
</html>